]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
dash: Use a single code path for clearing the drag placeholder
authorFlorian Müllner <fmuellner@gnome.org>
Wed, 5 Jun 2013 12:17:20 +0000 (14:17 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Wed, 5 Jun 2013 13:32:43 +0000 (15:32 +0200)
We currently only keep track of old placeholders when moving past
the dragged app's current favorite position, as this is the only
case where we need to worry about jitter. Still, moving it into
_clearDragPlaceholder() allows us to consolidate code paths, which
is a good thing ...

https://bugzilla.gnome.org/show_bug.cgi?id=684618

js/ui/dash.js

index d6fd14cfff317b2dc0b9230a9bcf1c32e08d16da..79636fc49a8da5e57a79a2daeba1abf5ae09ec6d 100644 (file)
@@ -791,7 +791,12 @@ const Dash = new Lang.Class({
 
     _clearDragPlaceholder: function() {
         if (this._dragPlaceholder) {
+            this._animatingPlaceholdersCount++;
             this._dragPlaceholder.animateOutAndDestroy();
+            this._dragPlaceholder.connect('destroy',
+                Lang.bind(this, function() {
+                    this._animatingPlaceholdersCount--;
+                }));
             this._dragPlaceholder = null;
         }
         this._dragPlaceholderPos = -1;
@@ -828,16 +833,7 @@ const Dash = new Lang.Class({
 
             // Don't allow positioning before or after self
             if (favPos != -1 && (pos == favPos || pos == favPos + 1)) {
-                if (this._dragPlaceholder) {
-                    this._dragPlaceholder.animateOutAndDestroy();
-                    this._animatingPlaceholdersCount++;
-                    this._dragPlaceholder.connect('destroy',
-                        Lang.bind(this, function() {
-                            this._animatingPlaceholdersCount--;
-                        }));
-                }
-                this._dragPlaceholder = null;
-
+                this._clearDragPlaceholder();
                 return DND.DragMotionResult.CONTINUE;
             }